package beans;

import java.beans.*;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

public class ContratQuadriennal implements Serializable {

	private static final long serialVersionUID = -5745045676151178203L;

	private int numContrat;
	private Date dateContrat;
	private int duree;
	private Collection<Formation> listeFormations;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public ContratQuadriennal() {}
	
	public ContratQuadriennal(int numContrat, Date dateContrat, int duree) {
		super();
		this.numContrat = numContrat;
		this.dateContrat = dateContrat;
		this.duree = duree;
		this.listeFormations = null;
	}

	public Collection<Formation> getListeFormation() {
		return listeFormations;
	}

	public void setListeFormation(Collection<Formation> listeFormation) {
		this.listeFormations = listeFormation;
	}

	public int getNumContrat() {
		return numContrat;
	}
	
	public void setNumContrat(int numContrat) {
		this.numContrat = numContrat;
	}
	
	public Date getDateContrat() {
		return dateContrat;
	}
	
	public void setDateContrat(Date dateContrat) {
		this.dateContrat = dateContrat;
	}
	
	public int getDuree() {
		return duree;
	}
	
	public void setDuree(int duree) {
		this.duree = duree;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
